package rpc.registry;

import lombok.extern.slf4j.Slf4j;

//双检锁单例的实现，避免浪费
@Slf4j
public class RegistryFactory {
    private static volatile Registry registry;
    public static Registry getInstance(){
        if(registry == null){
            synchronized (RegistryFactory.class){
                if(registry == null){
                    registry = new EtcdRegistry();
                }
            }
        }
        return registry;
    }
}